<% block = @transaction.block %>
<% from_address_hash = @transaction.from_address_hash %>
<% from_address = @transaction.from_address %>
<% to_address_hash = @transaction.to_address_hash %>
<% created_address_hash = @transaction.created_contract_address_hash %>
<% type = if @transaction.type == 2, do: "2 (EIP-1559)", else: @transaction.type %>
<% base_fee_per_gas = if block, do: block.base_fee_per_gas, else: nil %>
<% max_priority_fee_per_gas = @transaction.max_priority_fee_per_gas %>
<% max_fee_per_gas = @transaction.max_fee_per_gas %>
<% burned_fee = 
  if !is_nil(max_fee_per_gas) and !is_nil(@transaction.gas_used) and !is_nil(base_fee_per_gas) do
    if Decimal.compare(max_fee_per_gas.value, 0) == :eq do
      %Wei{value: Decimal.new(0)}
    else
      Wei.mult(base_fee_per_gas, @transaction.gas_used)
    end
  else
    nil
  end %>
<% %Wei{value: burned_fee_decimal} = if is_nil(burned_fee), do: %Wei{value: Decimal.new(0)}, else: burned_fee %>
<% priority_fee_per_gas = if is_nil(max_priority_fee_per_gas) or is_nil(base_fee_per_gas), do: nil, else: Enum.min_by([max_priority_fee_per_gas, Wei.sub(max_fee_per_gas, base_fee_per_gas)], fn x -> Wei.to(x, :wei) end) %>
<% priority_fee = if is_nil(priority_fee_per_gas), do: nil, else: Wei.mult(priority_fee_per_gas, @transaction.gas_used) %>
<% decoded_input_data = decoded_input_data(@transaction) %>
<% status = transaction_status(@transaction) %>
<% circles_addresses_list = CustomContractsHelper.get_custom_addresses_list(:circles_addresses) %>
<% address_hash_str = if to_address_hash, do: "0x" <> Base.encode16(to_address_hash.bytes, case: :lower), else: nil %>
<% {:ok, created_from_address} = if to_address_hash, do: Chain.hash_to_address(to_address_hash), else: {:ok, nil} %>
<% created_from_address_hash_str = if from_address_hash(created_from_address), do: "0x" <> Base.encode16(from_address_hash(created_from_address).bytes, case: :lower), else: nil %>
<%= render BlockScoutWeb.Advertisement.TextAdView, "index.html", conn: @conn %>
<section class="fs-14" data-page="transaction-details" data-page-transaction-hash="<%= @transaction %>">
  <div class="row">
    <div class="col-md-12">
      <!-- Transaction Details -->
      <div class="card js-ad-dependant-mb-3">
        <div class="card-body">
          <%= cond do %>
            <% Enum.member?(circles_addresses_list, address_hash_str) -> %>
              <div class="custom-dapp-header-container">
                <img class="custom-address-icon"/>
              </div>
            <% Enum.member?(circles_addresses_list, created_from_address_hash_str) -> %>
              <div class="custom-dapp-header-container">
                <img class="custom-address-icon"/>
              </div>
            <% true -> %>
              <%= nil %>
          <% end %>
          <h1 class="card-title">
            <div style="display: inline-block; vertical-align: bottom; line-height: 25px;">
              <%= gettext "Transaction Details" %>
              <% personal_tx_tag = if assigns[:tx_tags], do: @tx_tags.personal_tx_tag, else: nil %>
              <%= if personal_tx_tag && personal_tx_tag.name !== :error do %>
                <%= render BlockScoutWeb.FormView, "_tag.html", text: personal_tx_tag.name, additional_classes: [tag_name_to_label(personal_tx_tag.name), "ml-1"] %>
              <% end %>
              <%= render BlockScoutWeb.AddressView, "_labels.html", tags: @tx_tags %>
            </div>
          </h1>
          <%= if status == :pending do %>
            <div class="tile tile-muted d-flex justify-content-center align-items-center mb-4">
              <div class="loading-spinner">
                <span class="loading-spinner-block-1"></span>
                <span class="loading-spinner-block-2"></span>
              </div>
              <%= gettext("This transaction is pending confirmation.") %>
            </div>
          <% end %>
          <div class="d-flex flex-row">
            <%= if show_tenderly_link?() do %>
              <div class="mr-4 mb-4">
                <%= render BlockScoutWeb.CommonComponentsView, "_tenderly_link.html",
                    transaction_hash: @transaction.hash,
                    tenderly_chain_path: tenderly_chain_path() %>
              </div>
            <% end %>
          </div>
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
              text: gettext("Unique character string (TxID) assigned to every verified transaction.") %>
              <%= gettext "Transaction Hash" %>
            </dt>
            <dd class="col-sm-9 col-lg-10" style="word-break: break-all;">
              <span class="transaction-details-address" data-test="transaction_detail_hash"><%= @transaction %> </span>
              <%= render BlockScoutWeb.CommonComponentsView, "_btn_copy.html",
                  additional_classes: ["btn-copy-icon-small", "btn-copy-icon-custom", "btn-copy-icon-no-borders"],
                  clipboard_text: @transaction,
                  aria_label: gettext("Copy Transaction Hash"),
                  title: gettext("Copy Txn Hash") %>
            </dd>
          </dl>
          <!-- Verify in other explorers -->
          <!-- <%= render BlockScoutWeb.AddressView, "_verify_other_explorers.html", hash: hash(@transaction), type: "tx" %> -->
          <!-- Result -->
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
              text: gettext("Current transaction state: Success, Failed (Error), or Pending (In Process)") %>
              <%= gettext "Result" %>
            </dt>
            <dd class="col-sm-9 col-lg-10">
              <% formatted_result = BlockScoutWeb.TransactionView.formatted_result(status) %>
              <span class="mr-4" data-transaction-status="<%= formatted_result %>"><%= render BlockScoutWeb.CommonComponentsView, "_status_icon.html", status: status %><%= formatted_result %></span>
            </dd>
          </dl>
          <!-- Status -->
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
              text: gettext("The status of the transaction: Confirmed or Unconfirmed.") %>
              <%= gettext "Status" %>
            </dt>
            <dd class="col-sm-9 col-lg-10">
              <% formatted_status = BlockScoutWeb.TransactionView.formatted_status(status) %>
              <% confirmations = confirmations(@transaction, block_height: @block_height) %>
              <span class="mr-4">
                <span data-transaction-status="<%= formatted_status %>">
                  <%= cond do %>
                    <% status == :pending -> %>
                      <%= render BlockScoutWeb.FormView, "_tag.html", text: formatted_status, additional_classes: ["large"] %></span>
                    <% @transaction.error == "dropped/replaced" -> %>
                      <%= render BlockScoutWeb.FormView, "_tag.html", text: @transaction.error, additional_classes: ["large"] %></span>
                    <% true -> %>
                      <%= render BlockScoutWeb.FormView, "_tag.html", text: formatted_status, additional_classes: ["success", "large"] %></span>
                  <% end %>
                
                <%= if confirmations > 0 do %>
                  <span class="bs-label large ml-2 confirmations-label"><%= gettext "Confirmed by " %><span data-selector="block-confirmations"><%= confirmations %></span><%= " " <> confirmations_ds_name(confirmations) %></span>
                <% end %>
              </span>
            </dd>
          </dl>
          <!-- Revert reason -->
          <%= if status == {:error, "Reverted"} || status == {:error, "execution reverted"} do %>
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                text: gettext("The revert reason of the transaction.") %>
              <%= gettext "Revert reason" %> </dt>
            <dd class="col-sm-9 col-lg-10">
              <%= case BlockScoutWeb.TransactionView.transaction_revert_reason(@transaction) do %>
                <% {:error, _contract_not_verified, candidates} when candidates != [] -> %>
                  <% {:ok, method_id, text, mapping} = Enum.at(candidates, 0) %>
                  <%= render(BlockScoutWeb.TransactionView, "_decoded_input_body.html", method_id: method_id, text: text, mapping: mapping, error: true) %>
                <% {:ok, method_id, text, mapping} -> %>
                  <%= render(BlockScoutWeb.TransactionView, "_decoded_input_body.html", method_id: method_id, text: text, mapping: mapping, error: true) %>
                <% _ -> %>
                  <% hex = BlockScoutWeb.TransactionView.get_pure_transaction_revert_reason(@transaction) %>
                  <% utf8 = BlockScoutWeb.TransactionView.decoded_revert_reason(@transaction) %>
                  <div class="tile tile-muted">
                      <pre class="pre-scrollable pre-scrollable-shorty pre-wrap mb-0"><code>Raw:<%= raw("\t") %><%= hex %><%= raw("\n") %>UTF-8:<%= raw("\t") %><%= utf8 %></code></pre>
                  </div>
              <% end %>
            </dd>
          </dl>
          <% end %>
          <!-- Block -->
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                text: gettext("Block number containing the transaction.") %>
              <%= gettext "Block" %></dt>
            <dd class="col-sm-9 col-lg-10" data-selector="block-number">
              <%= if block do %>
                <%= link(
                      block,
                      class: "transaction__link",
                      to: block_path(@conn, :show, block)
                    ) %>
              <% else %>
                <%= formatted_result(status) %>
              <% end %>
            </dd>
          </dl>
          <!-- Timestamp -->
          <%= if block && block.timestamp do %>
            <dl class="row">
              <dt class="col-sm-3 col-lg-2 text-muted">
                <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                  text: gettext("Date & time of transaction inclusion, including length of time for confirmation.") %>
                <%= gettext "Timestamp" %>
              </dt>
              <dd class="col-sm-9 col-lg-10" data-selector="block-timestamp">
                <i class="fa-regular fa-clock"></i>
                <span>
                  <span data-from-now="<%= block.timestamp %>"></span>
                </span>
                <%= case processing_time_duration(@transaction) do %>
                  <% :pending -> %>
                    <% nil %>
                  <% :unknown -> %>
                    <% nil %>
                  <% {:ok, interval_string} -> %>
                    | <%= gettext("Confirmed within") %> <%= interval_string %>
                <% end %>
              </dd>
            </dl>
          <% end %>
          <!-- Transaction Action -->
          <% %{transaction_actions: transaction_actions} = transaction_actions(@transaction) %>
          <%= if not Enum.empty?(transaction_actions) do %>
            <dl class="row">
              <dt class="col-sm-3 col-lg-2 text-muted">
                <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                  text: gettext("Highlighted events of the transaction.") %>
                <%= gettext "Transaction Action" %>
                <p id="actions-list-scroll-note"><%= gettext "Scroll to see more" %></p>
              </dt>
              <dd class="col-sm-9 col-lg-10 actions-list-mobile-container">
                <div class="mCustomScrollbar" style="max-height:100px;width:90%">
                  <% transaction_actions_indexed = Enum.with_index(transaction_actions) %>
                  <% transaction_actions_length = Enum.count(transaction_actions) %>
                  <%= for {action, i} <- transaction_actions_indexed do %>
                    <% action_assigns = Map.put(assigns, :action, action) %>
                    <% action_assigns = Map.put(action_assigns, :isLast, (i == transaction_actions_length - 1)) %>
                    <%= render BlockScoutWeb.TransactionView, "_actions.html", action_assigns %>
                  <% end %>
                </div>
              </dd>
            </dl>
          <% end %>
          <!-- From -->
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                text: gettext("Address (external or contract) sending the transaction.") %>
              <%= gettext "From" %></dt>
            <dd class="col-sm-9 col-lg-10">
              <%= render BlockScoutWeb.AddressView, "_link.html", address: from_address, contract: BlockScoutWeb.AddressView.contract?(from_address), use_custom_tooltip: false, trimmed: false %>
              <%= render BlockScoutWeb.AddressView, "_labels.html", tags: @from_tags %>
              <%= render BlockScoutWeb.CommonComponentsView, "_btn_copy.html",
                additional_classes: ["btn-copy-icon-small", "btn-copy-icon-custom", "btn-copy-icon-no-borders"],
                clipboard_text: Address.checksum(from_address_hash),
                aria_label: gettext("Copy From Address"),
                title: gettext("Copy From Address") %>
            </dd>
          </dl>
          <!-- To -->
          <% to_address = @transaction |> Map.get(:to_address) || @transaction |> Map.get(:created_contract_address) %>
          <% recipient_address_hash = to_address_hash || created_address_hash %>
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                text: gettext("Address (external or contract) receiving the transaction.") %>
              <%= if BlockScoutWeb.AddressView.contract?(to_address) && !created_address_hash do %>
                <%= gettext "Interacted With (To)" %>
              <% else %>
                <%= gettext "To" %>
              <% end %>
            </dt>
            <dd class="col-sm-9 col-lg-10">
              <%= cond do %>
                <% created_address_hash -> %>
                  [<%= gettext("Contract") %>&nbsp;
                  <%= render BlockScoutWeb.AddressView, "_link.html", address: to_address, contract: BlockScoutWeb.AddressView.contract?(to_address), use_custom_tooltip: false, trimmed: false %>
                  <%= render BlockScoutWeb.AddressView, "_labels.html", tags: @to_tags %>
                  &nbsp;<%= gettext("created") %>]
                  <%= render BlockScoutWeb.CommonComponentsView, "_btn_copy.html",
                    additional_classes: ["btn-copy-icon-small", "btn-copy-icon-custom", "btn-copy-icon-no-borders"],
                    clipboard_text: Address.checksum(recipient_address_hash),
                    aria_label: gettext("Copy To Address"),
                    title: gettext("Copy To Address") %>
                <% recipient_address_hash -> %>
                  <%= render BlockScoutWeb.AddressView, "_link.html", address: to_address, contract: BlockScoutWeb.AddressView.contract?(to_address), use_custom_tooltip: false, trimmed: false %>
                  <%= render BlockScoutWeb.AddressView, "_labels.html", tags: @to_tags %>
                  <%= render BlockScoutWeb.CommonComponentsView, "_btn_copy.html",
                    additional_classes: ["btn-copy-icon-small", "btn-copy-icon-custom", "btn-copy-icon-no-borders"],
                    clipboard_text: Address.checksum(recipient_address_hash),
                    aria_label: gettext("Copy To Address"),
                    title: gettext("Copy To Address") %>
                <% true -> %>
              <% end %>
            </dd>
          </dl>
          <%= case token_transfer_type(@transaction) do %>
            <% {_type, %{token_transfers: token_transfers} = transaction_with_transfers} when is_list(token_transfers) and token_transfers != [] -> %>
              <!-- Tokens Transferred -->
              <% %{transfers: transfers, mintings: mintings, burnings: burnings, creations: creations} = aggregate_token_transfers(transaction_with_transfers.token_transfers) %>
              <%= if Enum.count(transfers) > 0 do %>
                <dl class="row">
                  <dt class="col-sm-3 col-lg-2 text-muted">
                    <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                      text: gettext("List of token transferred in the transaction.") %>
                    <%= gettext "Tokens Transferred" %></dt>
                  <dd class="col-sm-9 col-lg-10 transfers-list-mobile-container">
                    <table cellpadding="3" cellspacing="0">
                      <%= for transfer <- transfers do %>
                        <%= render BlockScoutWeb.TransactionView, "_total_transfers_from_to.html", Map.put(assigns, :transfer, transfer) %>
                      <% end %>
                    </table>
                  </dd>
                </dl>
              <% end %>
              <!-- Tokens Minted -->
              <%= if Enum.count(mintings) > 0 do %>
                <dl class="row">
                  <dt class="col-sm-3 col-lg-2 text-muted">
                    <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                      text: gettext("List of token minted in the transaction.") %>
                    <%= gettext "Tokens Minted" %>
                  </dt>
                  <dd class="col-sm-9 col-lg-10 transfers-list-mobile-container">
                    <table cellpadding="3" cellspacing="0">
                      <%= for minting <- mintings do %>
                        <%= render BlockScoutWeb.TransactionView, "_total_transfers_from_to.html", Map.put(assigns, :transfer, minting) %>
                      <% end %>
                    </table>
                  </dd>
                </dl>
              <% end %>
              <!-- Tokens Burnt -->
              <%= if Enum.count(burnings) > 0 do %>
                <dl class="row">
                  <dt class="col-sm-3 col-lg-2 text-muted">
                    <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                      text: gettext("List of token burnt in the transaction.") %>
                    <%= gettext "Tokens Burnt" %></dt>
                  <dd class="col-sm-9 col-lg-10 transfers-list-mobile-container">
                  <%= for burning  <- burnings do %>
                    <table cellpadding="3" cellspacing="0">
                      <%= render BlockScoutWeb.TransactionView, "_total_transfers_from_to.html", Map.put(assigns, :transfer, burning) %>
                    </table>
                  <% end %>
                  </dd>
                </dl>
              <% end %>

              <%= if Enum.count(creations) > 0 do %>
                <dl class="row">
                  <dt class="col-sm-3 col-lg-2 text-muted">
                    <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                      text: gettext("List of ERC-1155 tokens created in the transaction.") %>
                    <%= gettext "Tokens Created" %></dt>
                  <dd class="col-sm-9 col-lg-10 transfers-list-mobile-container">
                  <%= for creation  <- creations do %>
                    <table cellpadding="3" cellspacing="0">
                      <%= render BlockScoutWeb.TransactionView, "_total_transfers_from_to.html", Map.put(assigns, :transfer, creation) %>
                    </table>
                  <% end %>
                  </dd>
                </dl>
              <% end %>
            <% _ -> %>
          <% end %>
          <!-- Value -->
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                text: gettext("Value sent in the native token (and USD) if applicable.") %>
              <%= gettext "Value" %>
            </dt>
            <dd class="col-sm-9 col-lg-10"> <%= value(@transaction) %>
            <%= if !empty_exchange_rate?(@exchange_rate) do %>
              (<span data-wei-value=<%= @transaction.value.value %>
                data-usd-exchange-rate=<%= @exchange_rate.usd_value %>>
              </span>)
            <% end %>
            </dd>
          </dl>
          <!-- Transaction Fee -->
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                text: gettext("Total transaction fee.") %>
              <%= gettext "Transaction Fee" %>
            </dt>
            <dd class="col-sm-9 col-lg-10">
              <%= formatted_fee(@transaction, denomination: :ether) %>

              <%= if !empty_exchange_rate?(@exchange_rate) do %>
                (<span data-wei-value=<%= fee(@transaction) %> data-usd-exchange-rate=<%= @exchange_rate.usd_value %>></span>)
              <% end %>
            </dd>
          </dl>
          <!-- Gas Price -->
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                text: gettext("Price per unit of gas specified by the sender. Higher gas prices can prioritize transaction inclusion during times of high usage.") %>
              <%= gettext "Gas Price" %>
            </dt>
            <dd class="col-sm-9 col-lg-10"> <%= gas_price(@transaction, :gwei) %> </dd>
          </dl>
          <%= if !is_nil(type) do %>
            <dl class="row">
              <dt class="col-sm-3 col-lg-2 text-muted">
                <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                  text: gettext("Transaction type, introduced in EIP-2718.") %>
                <%= gettext "Transaction Type" %>
              </dt>
              <dd class="col-sm-9 col-lg-10"> <%= type %> </dd>
            </dl>
          <% end %>
          <hr>
          <!-- Gas Limit -->
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                text: gettext("Maximum gas amount approved for the transaction.") %>
              <%= gettext "Gas Limit" %>
            </dt>
            <dd class="col-sm-9 col-lg-10"> <%= format_gas_limit(@transaction.gas) %> </dd>
          </dl>
          <%= if !is_nil(max_fee_per_gas) do %>
            <dl class="row">
              <dt class="col-sm-3 col-lg-2 text-muted">
                <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                  text: gettext("Maximum total amount per unit of gas a user is willing to pay for a transaction, including base fee and priority fee.") %>
                <%= gettext "Max Fee per Gas" %>
              </dt>
              <dd class="col-sm-9 col-lg-10"> <%= format_wei_value(max_fee_per_gas, :gwei) %> </dd>
            </dl>
          <% end %>
          <%= if !is_nil(max_priority_fee_per_gas) do %>
            <dl class="row">
              <dt class="col-sm-3 col-lg-2 text-muted">
                <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                  text: gettext("User defined maximum fee (tip) per unit of gas paid to validator for transaction prioritization.") %>
                <%= gettext "Max Priority Fee per Gas" %>
              </dt>
              <dd class="col-sm-9 col-lg-10"> <%= format_wei_value(max_priority_fee_per_gas, :gwei) %> </dd>
            </dl>
          <% end %>
          <%= if !is_nil(priority_fee) do %>
            <dl class="row">
              <dt class="col-sm-3 col-lg-2 text-muted">
                <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                  text: gettext("User-defined tip sent to validator for transaction priority/inclusion.") %>
                <%= gettext "Priority Fee / Tip" %>
              </dt>
              <dd class="col-sm-9 col-lg-10"> <%= format_wei_value(priority_fee, :ether) %> </dd>
            </dl>
          <% end %> 
           <%= if !is_nil(burned_fee) do %>
            <dl class="row">
              <dt class="col-sm-3 col-lg-2 text-muted">
                <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                  text: gettext("Amount of") <> " " <> Explorer.coin_name() <> " " <> gettext("burned for this transaction. Equals Block Base Fee per Gas * Gas Used.") %>
                <%= gettext "Transaction Burnt Fee" %>
              </dt>
              <dd class="col-sm-9 col-lg-10"><i class="fa-solid fa-fire i-tooltip-2"></i> <%= format_wei_value(burned_fee, :ether) %>
                <%= unless empty_exchange_rate?(@exchange_rate) do %>
                  (<span data-wei-value=<%= burned_fee_decimal %> data-usd-exchange-rate=<%= @exchange_rate.usd_value %>></span>)
                <% end %>
              </dd>
            </dl>
          <% end %>
          <!-- Gas Used by Transaction -->
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted transaction-gas-used">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                text: gettext("Actual gas amount used by the transaction.") %>
              <%= gettext "Gas Used by Transaction" %>
            </dt>
            <% gas_used_perc = gas_used_perc(@transaction) %>
            <dd class="col-sm-9 col-lg-10"> <%= gas_used(@transaction) %> <%= if gas_used_perc, do: "| #{gas_used_perc}%" %></dd>
          </dl>
          <!-- Nonce, Index in Block -->
          <dl class="row">
            <dt class="col-sm-3 col-lg-2 text-muted">
              <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                text: gettext("Transaction number from the sending address. Each transaction sent from an address increments the nonce by 1.") %>
              <%= gettext "Nonce" %><span class="index-label ml-2"
                                          data-toggle="tooltip"
                                          title="<%= gettext("Index position of Transaction in the block.") %>"><%= gettext "Position" %></span>
            </dt>
            <dd class="col-sm-9 col-lg-10"> <%= @transaction.nonce %><span class="index-label ml-2"><%= if block, do: @transaction.index, else: formatted_result(status) %></span> </dd>
          </dl>
          <%= unless value_transfer?(@transaction) do %>
            <dl class="row">
              <dt class="col-sm-3 col-lg-2 text-muted">
                <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
                  text: gettext("Binary data included with the transaction. See input / logs below for additional info.") %>
                <%= gettext "Raw Input" %>
              </dt>
              <dd class="col-sm-9 col-lg-10">
                <div class="d-flex mb-3 justify-content-between">
                  <!-- Dropdown -->
                  <div class="dropdown">
                    <button class="btn-dropdown-line large dropdown-toggle" type="button" id="tx-input-decoding-button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                      <%= gettext("Hex (Default)") %>
                    </button>
                    <div class="dropdown-menu" aria-labelledby="transaction-input-decoding-button">
                      <a href class="dropdown-item large tx-input-dropdown" data-target=".tx-raw-input" data-target-to-hide=".tx-utf8-input" id="tx-dropdown-raw">
                        <%= gettext("Hex (Default)") %>
                      </a>
                      <a href class="dropdown-item large tx-input-dropdown" data-target=".tx-utf8-input" data-target-to-hide=".tx-raw-input" id="tx-dropdown-utf8">
                        <%= gettext("UTF-8") %>
                      </a>
                    </div>
                  </div>
                  <div class="btn-copy-tx-raw-input-container">
                    <!-- Copy Hex input -->
                    <%= render BlockScoutWeb.CommonComponentsView, "_btn_copy.html",
                        id: "tx-raw-input",
                        additional_classes: ["btn-copy-icon-small", "btn-copy-icon-no-borders", "btn-copy-icon-ml-0", "btn-copy-tx-raw-input", "tx-raw-input"],
                        clipboard_text: @transaction.input,
                        aria_label: gettext("Copy Value"),
                        title: gettext("Copy Txn Hex Input") %>
                    <!-- Copy UTF-8 input  -->
                    <%= render BlockScoutWeb.CommonComponentsView, "_btn_copy.html",
                        additional_classes: ["btn-copy-icon-small", "btn-copy-icon-no-borders", "btn-copy-icon-ml-0", "btn-copy-tx-raw-input", "tx-utf8-input"],
                        clipboard_text: @transaction.input.bytes,
                        aria_label: gettext("Copy Value"),
                        title: gettext("Copy Txn UTF-8 Input"),
                        style: "display: none;" %>
                  </div>
                </div>
                <!-- Textarea -->
                <div class="tx-raw-input">
                  <div class="tile tile-muted">
                    <pre class="pre-scrollable pre-scrollable-shorty pre-wrap mb-0"><code><%= @transaction.input %></code></pre>
                  </div>
                </div>
                <!-- Textfield -->
                <div class="tx-utf8-input" style="display: none;">
                  <div class="tile tile-muted">
                    <pre class="pre-scrollable pre-scrollable-shorty pre-wrap mb-0"><code><%= @transaction.input.bytes %></code></pre>
                  </div>
                </div>
              </dd>
            </dl>
          <% end %>
        </div>
      </div>
    </div>
  </div>

  <%= render BlockScoutWeb.Advertisement.BannersAdView, "_banner_728.html", conn: @conn %>

  <%= unless skip_decoding?(@transaction) do %>
    <div class="row">
      <div class="col-md-12">
        <%= render BlockScoutWeb.TransactionView, "_decoded_input.html", Map.put(assigns, :decoded_input_data, decoded_input_data) %>
      </div>
    </div>
  <% end %>
  <script defer data-cfasync="false" src="<%= static_path(@conn, "/js/transaction.js") %>"></script>
</section>
